home *** CD-ROM | disk | FTP | other *** search
/ Micromanía: 150 Juegos 2009 / 150Juegos_15.iso / Shareware / Ant Academy / antacademy.dba < prev    next >
Encoding:
Text File  |  2004-10-31  |  46.5 KB  |  2,353 lines

  1.  
  2. Rem Project: ant academy
  3. Rem Created: 31/07/2004 14:39:37
  4.  
  5. Rem ***** Main Source File *****
  6.  
  7. rem SET UP STUFF
  8.  
  9. randomize timer()
  10. sync on
  11. sync rate 200
  12. set display mode 800,600,32
  13. sync
  14. autocam off
  15. hide mouse
  16. disable escapekey
  17. ink 0,0
  18. color backdrop 0
  19. cheat=0
  20.  
  21. type levelinfotype
  22. terrain as byte
  23. obj as word
  24. pickup as byte
  25. appleno as word
  26. endtype
  27.  
  28. type objinfotype
  29. obj as word
  30. x#
  31. y#
  32. z#
  33. endtype
  34.  
  35. type antinfo
  36. oldx
  37. oldy
  38. oldz
  39. x#
  40. y#
  41. z#
  42. xmove#
  43. ymove#
  44. zmove#
  45. xmoveorig#
  46. ymoveorig#
  47. zmoveorig#
  48. yangle#
  49. endtype
  50.  
  51. type appleinfo
  52. obj as word
  53. alive as byte
  54. timer#
  55. start as word
  56. min as word
  57. max as word
  58. x
  59. y
  60. z
  61. endtype
  62.  
  63. type randomappleinfo
  64. alive as byte
  65. obj as word
  66. x as byte
  67. y as byte
  68. z as byte
  69. endtype
  70.  
  71. type pickupparticleinfo
  72. alive
  73. fade#
  74. x#
  75. y#
  76. z#
  77. xvel#
  78. yvel#
  79. endtype
  80.  
  81. type menustarinfo
  82. x#
  83. y#
  84. xvel#
  85. yvel#
  86. img
  87. endtype
  88.  
  89. type messageletterinfo
  90. img
  91. x#
  92. y#
  93. endtype
  94.  
  95. type highscoreinfo
  96. name$
  97. score
  98. endtype
  99.  
  100.  
  101. dim ant(200) as antinfo
  102. dim objinfo(1000) as objinfotype
  103. dim level(100,10,100) as levelinfotype
  104. dim apple(10) as appleinfo
  105. dim randomapple(0) as randomappleinfo
  106. dim pickupparticle(20) as pickupparticleinfo
  107. dim menustar(60) as menustarinfo
  108. dim messageletter(1) as messageletterinfo
  109. dim highscore(10) as highscoreinfo
  110. dim keytype$(250)
  111.  
  112. for x=0 to 200
  113. keytype$(x)=""
  114. next x
  115. restore keytypedata
  116. read temp$
  117. for x=2 to 11
  118. keytype$(x)=mid$(temp$,x-1)
  119. next x
  120. read temp$
  121. for x=16 to 25
  122. keytype$(x)=mid$(temp$,x-15)
  123. next x
  124. read temp$
  125. for x=30 to 38
  126. keytype$(x)=mid$(temp$,x-29)
  127. next x
  128. read temp$
  129. for x=44 to 50
  130. keytype$(x)=mid$(temp$,x-43)
  131. next x
  132. keytype$(57)=" "
  133.  
  134. keytypedata:
  135.  
  136. data "1234567890"
  137. data "qwertyuiop"
  138. data "asdfghjkl"
  139. data "zxcvbnm"
  140.  
  141.  
  142. for x=1 to 60
  143. menustar(x).x#=rnd(800)
  144. menustar(x).y#=x*10
  145. menustar(x).img=8+rnd(2)
  146. menustar(x).xvel#=(((rnd(30)+5)/10))-1.5
  147. menustar(x).yvel#=(((rnd(10)+5)/10))+1
  148. next x
  149.  
  150.  
  151. levelno=1
  152. left=203
  153. right=205
  154. up=200
  155. down=208
  156. obno=501
  157. global particleindex
  158. particleindex=1
  159. global quit
  160. quit=0
  161.  
  162. rem LOAD INTRO MEDIA
  163. load image "gfx\cover.png",3
  164. load image "gfx\cover2.png",4
  165. make object cube 1,1
  166. hide object 1
  167.  
  168. load image "gfx\fb1.png",1,1
  169. load image "gfx\fb2.png",2,1
  170. sprite 1,400,400,1
  171. offset sprite 1,sprite width(1)/2,sprite height(1)/2
  172. sprite 3,400,350,3
  173. set sprite priority 1,3
  174. offset sprite 3,sprite width(3)/2,0
  175. set sprite priority 3,4
  176. rem INTRO
  177. for x=500 to 300 step -1
  178. sprite 1,400,x,1
  179. offset sprite 1,sprite width(1)/2,sprite height(1)/2
  180. sync
  181. wait 4
  182. next x
  183. delete sprite 3
  184. sprite 2,400,300,2
  185. offset sprite 2,sprite width(2)/2,sprite height(2)/2
  186. set sprite priority 2,1
  187.  
  188. sprite 3,0,300,4
  189. offset sprite 3,0,50
  190. set sprite priority 3,2
  191. for x= -100 to 800 step 2
  192. sprite 3,x,300,4
  193. sync
  194. next x
  195. opscreenres=2
  196. opantpoly=4
  197. opmusic=1
  198. opsoundfx=1
  199.  
  200. if file exist("settings.dat")=1
  201.  open to read 1,"settings.dat"
  202.  read file 1,opscreenres
  203.  read file 1,opantpoly
  204.  read file 1,opmusic
  205.  read file 1,opsoundfx
  206. else
  207.  open to write 1,"settings.dat"
  208.  write file 1,opscreenres
  209.  write file 1,opantpoly
  210.  write file 1,opmusic
  211.  write file 1,opsoundfx
  212. endif
  213.  
  214. close file 1
  215.  
  216. open to read 1,"leveldata\level10.dat"
  217.  read string 1,temp$
  218.  highscore(1).name$=temp$
  219.  read file 1,temp
  220.  highscore(1).score=temp
  221. close file 1
  222.  
  223. wait key
  224.  
  225. for x=255 to 0 step -1
  226. set sprite alpha 1,x
  227. set sprite alpha 2,x
  228. sync
  229. next x
  230. rem DESTROY INTRO MEDIA
  231. for x=1 to 3
  232. delete sprite x
  233. delete image x
  234. next x
  235. delete image 4
  236. delete object 1
  237.  
  238. color backdrop rgb (255,255,255)
  239. backdrop off
  240. draw to back
  241. gosub loadmenumedia
  242. menu:
  243.  
  244.  
  245. dim message$(5)
  246. message$(1)="ants need to learn how to make a line from food source to nest so they come to ant academy where you teach them to march from a to b easy eh?"
  247. message$(2)="  okay scoring goes like this, every apple you eat adds another ant to line, you score 1x ants in line for green apple, 2x for red apple and 4x for gold apple."
  248. message$(3)="  red apples are placed in tricky places and gold are placed in dangerous places.  as soon as you got enough ants either make a line from a to b or try to build your score,"
  249. message$(4)=" remember the more ants in the line then the more you score.  at 1000 points you get an extra life, at 2500 you get another and then you get another at every 5000 points."
  250. message$(5)="  okay congratulations and hushed awe at our leading scorer "+highscore(1).name$+" with a high score of "+str$(highscore(1).score)+"."
  251.  
  252. mesno=1
  253. temp=0
  254. for x=1 to 5
  255. temp=temp+len(message$(x))
  256. next x
  257. z=0
  258. templen=1
  259. for x=1 to temp
  260. if templen>len(message$(mesno))
  261.  inc mesno
  262.  templen=1
  263. endif
  264. if mid$(message$(mesno),templen)=" " then inc z,1
  265. inc templen
  266. next x
  267. z=temp-z
  268. messagelength=z
  269. undim messageletter(0)
  270. dim messageletter(z) as messageletterinfo
  271. messageindex=1
  272. messagex=810
  273. mesno=1
  274. templen=1
  275. for x=1 to temp
  276. if templen>len(message$(mesno))
  277.  inc mesno
  278.  templen=1
  279. endif
  280. temp$=mid$(message$(mesno),templen)
  281. if temp$<>" "
  282. messageletter(messageindex).img=asc(temp$)
  283. messageletter(messageindex).x#=messagex
  284. `if temp$="." or temp$=","
  285.  `mlypos=550
  286. `else
  287.  `mlypos=530
  288. `endif
  289. `messageletter(messageindex).yorig#=mlypos
  290. `messageletter(messageindex).y#=mlypos
  291. sprite 73,-50,-50,messageletter(messageindex).img
  292. inc messagex,sprite width(73)+3
  293. inc messageindex,1
  294. else
  295. inc messagex,25
  296. endif
  297. inc templen
  298. next x
  299.  
  300. messagewidth=messagex
  301.  
  302. sprite 68,400,300,11
  303. sprite 69,400,370,12
  304. sprite 70,400,440,13
  305. for x=68 to 70
  306. offset sprite x,sprite width(x)/2,sprite height(x)/2
  307. set sprite priority x,2
  308. hide sprite x
  309. next x
  310.  
  311. rem menu
  312.  
  313. sprite 1,400,300,1
  314. offset sprite 1,400,300
  315. set sprite priority 1,10
  316. sprite 2,0,0,2
  317.  
  318. sprite 3,400,300,3
  319. sprite 4,400,370,4
  320. sprite 5,400,440,5
  321. sprite 6,400,80,6
  322. sprite 7,400,200,7
  323. for x=1 to 60
  324. sprite (x+7),menustar(x).x#,menustar(x).y#,menustar(x).img
  325. next x
  326. for x=3 to 7
  327. offset sprite x,sprite width(x)/2,sprite height(x)/2
  328. set sprite priority x,3
  329. next x
  330. for x=8 to 67
  331. offset sprite x,sprite width(x)/2,sprite height(x)/2
  332. set sprite priority x,1
  333. next x
  334.  
  335. scale=100
  336. alph=255
  337. loop music 1
  338. cheatkey=25
  339. sprite 1000,400,300,200
  340. offset sprite 1000,sprite width(1000)/2,sprite height(1000)/2
  341. hide sprite 1000
  342. set sprite priority 1000,10
  343. sprite 1001,400,300,201
  344. offset sprite 1001,sprite width(1001)/2,sprite height(1001)/2
  345. hide sprite 1001
  346. set sprite priority 1001,10
  347.  
  348. repeat
  349.  
  350.  
  351.  
  352.  
  353. option=0
  354. sprite 71,mousex(),mousey(),14
  355. set sprite priority 71,5
  356. for x=1 to 3
  357. if mousex()>(sprite x(x+2)-(sprite width(x+2)/2)) and mousex()<(sprite x(x+2)+(sprite width(x+2)/2)) and mousey()>(sprite y(x+2)-(sprite height(x+2)/2)) and mousey()<(sprite y(x+2)+(sprite height(x+2)/2))
  358.  option=x
  359.  exit
  360. endif
  361. next x
  362. hide sprite 68
  363. hide sprite 69
  364. hide sprite 70
  365. if option
  366.  show sprite option+67
  367. endif
  368. for x=1 to 60
  369. inc menustar(x).x#,menustar(x).xvel#
  370. inc menustar(x).y#,menustar(x).yvel#
  371. if menustar(x).y#>630
  372. menustar(x).y#=0-rnd(100)
  373. menustar(x).x#=rnd(1600)-400
  374. endif
  375. sprite x+7,menustar(x).x#,menustar(x).y#,menustar(x).img
  376. next x
  377. scale sprite 1,scale
  378. inc scale,10
  379. if scale>800 and alph=>0
  380.  set sprite alpha 1,alph
  381.  dec alph,1
  382. endif
  383. sync
  384. until scale>1000 and alph<0
  385. delete sprite 1
  386.  
  387. start=0
  388.  
  389. repeat
  390.  
  391. if keystate(25) then cheatkey=47
  392.  
  393. if keystate(cheatkey)
  394.  if cheatkey=47
  395.   cheatkey=33
  396.  else
  397.   if cheatkey=33
  398.    cheatkey=46
  399.   else
  400.    if cheatkey=46
  401.     cheatkey=25
  402.     cheatalph=255
  403.     cheatalphtimer=timer()+200
  404.     if cheat=1
  405.      cheat=0
  406.      hide sprite 1000
  407.      show sprite 1001
  408.     else
  409.      cheat=1
  410.      hide sprite 1001
  411.      show sprite 1000
  412.     endif
  413.    endif
  414.   endif
  415.  endif
  416. endif
  417.  
  418. if sprite visible(1000)
  419.  set sprite alpha 1000,cheatalph
  420. else
  421.  if sprite visible(1001)
  422.   set sprite alpha 1001,cheatalph
  423.  endif
  424. endif
  425.  
  426. if cheatalph>0 and timer()>cheatalphtimer
  427.  dec cheatalph,5
  428.  cheatalphtimer=timer()+50
  429.  if cheatalph<=0
  430.   cheatalph=0
  431.   hide sprite 1000
  432.   hide sprite 1001
  433.  endif
  434. endif
  435.  
  436. option=0
  437. sprite 71,mousex(),mousey(),14
  438. set sprite priority 71,6
  439.  
  440. if sprite exist(72)=0
  441.  
  442. for x=1 to 3
  443. if mousex()>(sprite x(x+2)-(sprite width(x+2)/2)) and mousex()<(sprite x(x+2)+(sprite width(x+2)/2)) and mousey()>(sprite y(x+2)-(sprite height(x+2)/2)) and mousey()<(sprite y(x+2)+(sprite height(x+2)/2))
  444.  option=x
  445.  exit
  446. endif
  447. next x
  448. hide sprite 68
  449. hide sprite 69
  450. hide sprite 70
  451. if option
  452.  show sprite option+67
  453. endif
  454. if mouseclick()=1
  455. mouseclicked=1
  456.  select option
  457.   case 1
  458.    start=1
  459.   endcase
  460.   case 2
  461.    sprite 72,400,300,15
  462.    sprite 73,400,110,16
  463.    sprite 74,400,210,17
  464.    sprite 75,400,310,18
  465.    sprite 76,400,410,19
  466.    sprite 77,400,150,opscreenres+19
  467.    sprite 78,400,250,opantpoly+22
  468.    sprite 79,400,350,opmusic+26
  469.    sprite 80,400,450,opsoundfx+26
  470.  
  471.    offset sprite 72,sprite width(72)/2,sprite height(72)/2
  472.    set sprite priority 72,4
  473.    hide sprite 69
  474.    for x=73 to 80
  475.     offset sprite x,sprite width(x)/2,sprite height(x)/2
  476.     set sprite priority x,5
  477.    next x
  478.   endcase
  479.   case 3
  480.    end
  481.   endcase
  482.  endselect
  483. endif
  484.  
  485. else
  486.  
  487. opselect=0
  488. for x=1 to 8
  489. if mousex()>(sprite x(x+72)-(sprite width(x+72)/2)) and mousex()<(sprite x(x+72)+(sprite width(x+72)/2)) and mousey()>(sprite y(x+72)-(sprite height(x+72)/2)) and mousey()<(sprite y(x+72)+(sprite height(x+72)/2))
  490.  opselect=x
  491.  exit
  492. endif
  493. next x
  494.  
  495.    sprite 77,400,150,opscreenres+19
  496.    sprite 78,400,250,opantpoly+22
  497.    sprite 79,400,350,opmusic+26
  498.    sprite 80,400,450,opsoundfx+26
  499.  
  500.    sprite 81,400,150,opscreenres+28
  501.    sprite 82,399,109,32
  502.    if opantpoly=2
  503.     sprite 83,400,250,34
  504.    else
  505.     if opantpoly=1
  506.      sprite 83,399,250,33
  507.     else
  508.      sprite 83,399,249,opantpoly+32
  509.     endif
  510.    endif
  511.    sprite 84,400,209,37
  512.    sprite 85,399,350,opmusic+37
  513.    sprite 86,400,309,40
  514.    sprite 87,399,450,opsoundfx+37
  515.    sprite 88,399,409,41
  516.    for x=81 to 88
  517.    hide sprite x
  518.    next x
  519.  
  520.  for x=77 to 88
  521.   offset sprite x,sprite width(x)/2,sprite height(x)/2
  522.   set sprite priority x,5
  523.  next x
  524.  
  525.  
  526. select opselect
  527.  case 1
  528.  show sprite 82
  529.  endcase
  530.  case 2
  531.  show sprite 84
  532.  endcase
  533.  case 3
  534.  show sprite 86
  535.  endcase
  536.  case 4
  537.  show sprite 88
  538.  endcase
  539.  case 5
  540.  show sprite 81
  541.  endcase
  542.  case 6
  543.  show sprite 83
  544.  endcase
  545.  case 7
  546.  show sprite 85
  547.  endcase
  548.  case 8
  549.  show sprite 87
  550.  endcase
  551.  
  552. endselect
  553.  
  554. if mouseclick()<>1 then mouseclicked=0
  555.  
  556. if mouseclick()=1 and mouseclicked=0
  557. mouseclicked=1
  558.  
  559. if opselect=1 or opselect=5
  560.  inc opscreenres
  561.  if opscreenres>3 then opscreenres=1
  562. else
  563.  if opselect=2 or opselect=6
  564.   inc opantpoly
  565.   if opantpoly>4 then opantpoly=1
  566.  else
  567.   if opselect=3 or opselect=7
  568.    if opmusic=1
  569.     opmusic=2
  570.    else
  571.     opmusic=1
  572.    endif
  573.   else
  574.    if opselect=4 or opselect=8
  575.     if opsoundfx=1
  576.      opsoundfx=2
  577.     else
  578.      opsoundfx=1
  579.     endif
  580.    endif
  581.   endif
  582.  endif
  583. endif
  584.  
  585.  
  586. endif
  587.  
  588. if mousex()<(sprite x(72)-sprite width(72)/2) or mousex()>(sprite x(72)+sprite width(72)/2) or mousey()<(sprite y(72)-sprite height(72)/2) or mousey()>(sprite y(72)+sprite height(72)/2)
  589.  for x=72 to 88
  590.   delete sprite x
  591.  next x
  592. endif
  593.  
  594. endif
  595.  
  596.  
  597. for x=1 to 60
  598. inc menustar(x).x#,menustar(x).xvel#
  599. inc menustar(x).y#,menustar(x).yvel#
  600. if menustar(x).y#>630
  601. menustar(x).y#=0-rnd(100)
  602. menustar(x).x#=rnd(1600)-400
  603. endif
  604. sprite x+7,menustar(x).x#,menustar(x).y#,menustar(x).img
  605. next x
  606.  
  607. messagesprite=89
  608. for x=1 to messagelength
  609. if sprite exist(x+88) then delete sprite x+88
  610. if messageletter(x).x#<800
  611.  if messageletter(x).img=44 or messageletter(x).img=46
  612.   sprite messagesprite,messageletter(x).x#,messageletter(x).y#+20,messageletter(x).img
  613.  else
  614.   sprite messagesprite,messageletter(x).x#,messageletter(x).y#,messageletter(x).img
  615.  endif
  616.  set sprite priority messagesprite,4
  617.  inc messagesprite,1
  618. endif
  619. next x
  620. for x=messagelength to 1 step -1
  621. dec messageletter(x).x#,1
  622. if messageletter(x).x#<-50
  623.  messageletter(x).x#=messagewidth
  624. endif
  625. if x=1
  626.  messageletter(x).y#=530+(sin(ang#)*20)
  627.  ang#=wrapvalue(ang#+3)
  628. else
  629.  messageletter(x).y#=messageletter(x-1).y#
  630. endif
  631.  
  632. next x
  633.  
  634. sync
  635.  
  636.  
  637. until start
  638. y=800
  639. make object plain 101,250,250
  640. texture object 101,42
  641. set object texture 101,2,0
  642. set object transparency 101,4
  643. set object light 101,0
  644. position object 101,-250,0,200
  645. lock object on 101
  646. make object plain 102,250,250
  647. zrotate object 102,180
  648. texture object 102,42
  649. set object texture 102,2,0
  650. set object transparency 102,4
  651. set object light 102,0
  652. position object 102,200,0,200
  653. lock object on 102
  654. y=250
  655. for z=-250 to -70 step 3
  656. position object 101,z,0,200
  657. position object 102,y,0,200
  658. dec y,3
  659. for x=1 to 60
  660. inc menustar(x).x#,menustar(x).xvel#
  661. inc menustar(x).y#,menustar(x).yvel#
  662. if menustar(x).y#>630
  663. menustar(x).y#=0-rnd(100)
  664. menustar(x).x#=rnd(1600)-400
  665. endif
  666. sprite x+7,menustar(x).x#,menustar(x).y#,menustar(x).img
  667. next x
  668. sync
  669. next z
  670.  
  671. for x=1 to 71
  672. if x>1 then delete sprite x
  673. if x<43 then delete image x
  674. next x
  675. delete image 46
  676. delete image 44
  677. delete image 63
  678. delete image 200
  679. delete image 201
  680. delete sprite 1000
  681. delete sprite 1001
  682. delete object 101
  683. delete object 102
  684.  
  685. for x=0 to 9
  686. delete image 48+x
  687. next x
  688. for x=1 to 26
  689. delete image x+96
  690. next x
  691.  
  692. for x=1 to messagelength
  693. if sprite exist(x+88) then delete sprite x+88
  694. next x
  695.  
  696. rem MAIN GAME
  697. ants=0
  698. score=0
  699. extralife=1000
  700. if cheat=1
  701.  lives=99
  702. else
  703.  lives=5
  704. endif
  705. levelno=1
  706. bgno=1
  707. bgmus=1
  708. complete=0
  709. applesalive=0
  710.  
  711. if opscreenres=1
  712.  if check display mode(640,480,16) then set display mode 640,480,16
  713. else
  714.  if opscreenres=3
  715.   if check display mode(1024,768,32) then set display mode 1024,768,32
  716.  endif
  717. endif
  718. color backdrop rgb(255,255,255)
  719. load image "gfx\wipe3.png",42,1
  720. make object plain 101,250,250
  721. texture object 101,42
  722. set object texture 101,2,0
  723. set object transparency 101,1
  724. set object light 101,0
  725. position object 101,-70,0,200
  726. lock object on 101
  727. make object plain 102,250,250
  728. zrotate object 102,180
  729. texture object 102,42
  730. set object texture 102,2,0
  731. set object transparency 102,1
  732. set object light 102,0
  733. position object 102,70,0,200
  734. lock object on 102
  735. gosub loadgamemedia
  736. gosub loadlevelmedia
  737. gosub positioncamera
  738.  
  739. wipeoff()
  740.  
  741. fps=200
  742. makenewant=0
  743. alph1=0
  744. directionpicked=0
  745. `gosub positioncamera
  746.  
  747. loop object 1000
  748.  
  749. frames=39
  750. seconds#=timer()-1
  751. fps=200
  752.  
  753. do
  754. if music playing(1)=0 then loop music 1
  755.  
  756. inc frames,1
  757. if timer()>seconds#
  758.  seconds#=timer()+200
  759.  fps=frames*5
  760.  if frames>maxframes then maxframes=frames
  761.  frames=0
  762. endif
  763.  
  764.  
  765.  
  766. gosub keyboardinput
  767.  
  768. gosub positionants
  769. gosub positioncamera
  770.  
  771. gosub movepickupparticles
  772. spin#=75.0/fps
  773. position object 2001,ant(0).x#-6,ant(0).y#+8,ant(0).z#-1
  774. xrotate object 2001,object angle x(2001)+spin#
  775. yrotate object 2001,object angle y(2001)+spin#
  776. zrotate object 2001,object angle z(2001)+spin#
  777. position object 2002,ant(0).x#+6,ant(0).y#+8,ant(0).z#-1
  778. xrotate object 2002,object angle x(2002)-spin#
  779. yrotate object 2002,object angle y(2002)-spin#
  780. zrotate object 2002,object angle z(2002)-spin#
  781. if keystate(1)
  782.  seconds#=pausegame(seconds#-timer(),opmusic,ants)
  783.  if quit
  784.  delete music 1
  785.  for x=1 to 4
  786.  delete sound x
  787.  next x
  788.  for x=1000 to 1000+ants
  789.  delete object x
  790.  next x
  791.  for x=400 to 500+objs
  792.  if object exist(x) then delete object x
  793.  next x
  794.  for x=1 to 100
  795.  if sprite exist(x) then delete sprite x
  796.  if image exist(x) then delete image x
  797.  next x
  798.  set display mode 800,600,32
  799.  gosub loadmenumedia
  800.  goto menu
  801.  endif
  802. endif
  803.  
  804. sync
  805.  
  806. loop
  807.  
  808. rem *** SUB ROUTINES ***
  809.  
  810. loadgamemedia:
  811.  
  812. load sound "sound\fall.wav",1
  813. load sound "sound\crash.wav",2
  814. load sound "sound\bite.wav",3
  815. load sound "sound\gameover.wav",4
  816. set sound volume 3,85
  817.  
  818.  
  819. if opsoundfx=2
  820. for x=1 to 3
  821. set sound volume x,0
  822. next x
  823. endif
  824.  
  825.  
  826. if opantpoly=1
  827.  make object box 1000,0.5,1.5,0.5
  828.  color object 1000,rgb(255,0,0)
  829.  yoffset#=1
  830. else
  831.  if opantpoly=2
  832.   make object box 1000,0.5,1.5,0.5
  833.   color object 1000,rgb(255,0,0)
  834.   yoffset#=1
  835.  else
  836.   if opantpoly=3
  837.    load object "gfx\antmp.dbo",1000
  838.    color object 1000,rgb(255,0,0)
  839.    yoffset#=1
  840.   else
  841.    load object "gfx\anthp.dbo",1000
  842.    yoffset#=1.5
  843.    yrotate object 1000,180
  844.    fix object pivot 1000
  845.   endif
  846.  endif
  847. endif
  848.  
  849. set object specular 1000,rgb(255,255,255)
  850. set object specular power 1000,25
  851.  
  852. position light 0,-50,150,-50
  853. point light 0,50,5,50
  854. make object plain 421,1,1
  855. make object plain 422,1,1
  856. load image "gfx\star1.png",31
  857. load image "gfx\star2.png",32
  858. texture object 421,31
  859. texture object 422,32
  860. set object transparency 421,1
  861. set object transparency 422,1
  862. for count=423 to 440 step 2
  863.  instance object count,421
  864.  hide object count
  865. next count
  866. for count=424 to 440 step 2
  867. instance object count,422
  868. hide object count
  869. next count
  870. load image "gfx\pbg.png",33,1
  871. load image "gfx\resume.png",35,1
  872. load image "gfx\quit.png",36,1
  873. return
  874.  
  875. loadmenumedia:
  876. load music "sound\menu1.mp3",1
  877. load image "gfx\wipe1.png",1,1
  878. load image "gfx\menu\menu.png",2,1
  879. load image "gfx\menu\start.png",3,1
  880. load image "gfx\menu\options.png",4,1
  881. load image "gfx\menu\exit.png",5,1
  882. load image "gfx\menu\ant.png",6,1
  883. load image "gfx\menu\acadamy.png",7,1
  884. load image "gfx\menu\starb.png",8,1
  885. load image "gfx\menu\starg.png",9,1
  886. load image "gfx\menu\stary.png",10,1
  887. load image "gfx\menu\startlit.png",11,1
  888. load image "gfx\menu\optionslit.png",12,1
  889. load image "gfx\menu\exitlit.png",13,1
  890. load image "gfx\menu\cursor.png",14,1
  891. load image "gfx\menu\optionbg.png",15,1
  892. load image "gfx\menu\opsr.png",16,1
  893. load image "gfx\menu\opam.png",17,1
  894. load image "gfx\menu\opm.png",18,1
  895. load image "gfx\menu\opsfx.png",19,1
  896. load image "gfx\menu\op640x480.png",20,1
  897. load image "gfx\menu\op800x600.png",21,1
  898. load image "gfx\menu\op1024x768.png",22,1
  899. load image "gfx\menu\opbox.png",23,1
  900. load image "gfx\menu\oplowpoly.png",24,1
  901. load image "gfx\menu\opmediumpoly.png",25,1
  902. load image "gfx\menu\ophighpoly.png",26,1
  903. load image "gfx\menu\opon.png",27,1
  904. load image "gfx\menu\opoff.png",28,1
  905. load image "gfx\menu\op640x480lit.png",29,1
  906. load image "gfx\menu\op800x600lit.png",30,1
  907. load image "gfx\menu\op1024x768lit.png",31,1
  908. load image "gfx\menu\opsrlit.png",32,1
  909. load image "gfx\menu\opboxlit.png",33,1
  910. load image "gfx\menu\oplowpolylit.png",34,1
  911. load image "gfx\menu\opmediumpolylit.png",35,1
  912. load image "gfx\menu\ophipolylit.png",36,1
  913. load image "gfx\menu\opamlit.png",37,1
  914. load image "gfx\menu\oponlit.png",38,1
  915. load image "gfx\menu\opofflit.png",39,1
  916. load image "gfx\menu\opmlit.png",40,1
  917. load image "gfx\menu\opsfxlit.png",41,1
  918. load image "gfx\wipe3.png",42,1
  919. for x=0 to 9
  920. load image "gfx\menu\font1\"+str$(x)+".png",48+x,1
  921. next x
  922. x$="abcdefghijklmnopqrstuvwxyz"
  923. for x=1 to 26
  924. load image "gfx\menu\font1\"+mid$(x$,x)+".png",96+x,1
  925. next x
  926. load image "gfx\menu\font1\fs.png",46,1
  927. load image "gfx\menu\font1\com.png",44,1
  928. load image "gfx\menu\font1\qm.png",63,1
  929. load image "gfx\menu\cheatson.png",200,1
  930. load image "gfx\menu\cheatsoff.png",201,1
  931. return
  932.  
  933. loadlevelmedia:
  934.  
  935.  
  936. if image exist(1) then delete image 1
  937. load image "leveldata\bg"+str$(bgno)+".png",1,1
  938. sprite 100,0,0,1
  939. size sprite 100,screen width(),screen height()
  940.  
  941. if music exist(1) then delete music 1
  942. load music "sound\midi\bg"+str$(bgmus)+".mid",1
  943. set music volume 1,50
  944. if opmusic=2
  945. set music volume 1,0
  946. endif
  947. load object "gfx\10x10bw.dbo",1
  948. load object "gfx\5x5b.dbo",2
  949. load object "gfx\5x5w.dbo",3
  950. make object box 4,1,1,1
  951. color object 4,0
  952. set object specular 4,rgb(255,255,255)
  953. set object specular power 4,4
  954. make object box 5,5,1,1
  955. color object 5,0
  956. set object specular 5,rgb(255,255,255)
  957. set object specular power 5,4
  958. make object box 6,10,1,1
  959. color object 6,0
  960. set object specular 6,rgb(255,255,255)
  961. set object specular power 6,4
  962. make object box 7,1,1,5
  963. color object 7,0
  964. set object specular 7,rgb(255,255,255)
  965. set object specular power 7,4
  966. make object box 8,1,1,10
  967. color object 8,0
  968. set object specular 8,rgb(255,255,255)
  969. set object specular power 8,4
  970. load object "gfx\applegreen.dbo",9
  971. load object "gfx\slant.dbo",10
  972. load object "gfx\slant2.dbo",11
  973. load object "gfx\slant3.dbo",12
  974. load object "gfx\slant4.dbo",13
  975. load object "gfx\a.dbo",14
  976. load object "gfx\b.dbo",15
  977. load object "gfx\a2.dbo",16
  978. load object "gfx\b2.dbo",17
  979. load object "gfx\slantb.dbo",18
  980. load object "gfx\slantb2.dbo",19
  981. load object "gfx\slantb3.dbo",20
  982. load object "gfx\slantb4.dbo",21
  983. load object "gfx\applered.dbo",22
  984. load object "gfx\applegold.dbo",23
  985.  
  986.  
  987.  
  988. for count=1 to 21
  989. set object ambient count,0
  990. next count
  991.  
  992.  ant(0).x#=50
  993.  ant(0).y#=5
  994.  ant(0).z#=50
  995.  xdir=0
  996.  ydir=0
  997.  zdir=-1
  998.  destination=1
  999.  
  1000. levname$="level"+str$(levelno)
  1001. appleno=1
  1002. randappleindex=0
  1003. if file exist("leveldata\"+levname$+".dat")
  1004.  open to read 1,"leveldata\"+levname$+".dat"
  1005.  read word 1,objs
  1006.  read word 1,apples
  1007.  read word 1,randomapples
  1008.  read word 1,temp
  1009.  ant(0).x#=temp
  1010.  read word 1,temp
  1011.  ant(0).y#=temp
  1012.  read word 1,temp
  1013.  ant(0).z#=temp
  1014.  for count=1 to randomapples
  1015.   clone object count+400,9
  1016.   hide object count+400
  1017.  next count
  1018.  for count=1 to objs
  1019.   read word 1,temp
  1020.   objinfo(count).obj=temp
  1021.   read float 1,temp#
  1022.   objinfo(count).x#=temp#
  1023.   read float 1,temp#
  1024.   objinfo(count).y#=temp#
  1025.   read float 1,temp#
  1026.   objinfo(count).z#=temp#
  1027.  next count
  1028. for count=0 to 100
  1029.  for count2=0 to 10
  1030.   for count3=0 to 100
  1031.    read byte 1,temp
  1032.    level(count,count2,count3).terrain=temp
  1033.    read word 1,temp
  1034.    level(count,count2,count3).obj=temp
  1035.    read byte 1,temp
  1036.    level(count,count2,count3).pickup=temp
  1037.    if temp=1 or temp=3 or temp=4
  1038.     apple(appleno).obj=level(count,count2,count3).obj
  1039.     apple(appleno).alive=0
  1040.     level(count,count2,count3).appleno=appleno
  1041.     apple(appleno).x=count
  1042.     apple(appleno).y=count2
  1043.     apple(appleno).z=count3
  1044.     inc appleno
  1045.    else
  1046.     if temp=2
  1047.      if levelno<>5 or count2=5
  1048.       inc randappleindex,1
  1049.       array insert at bottom randomapple(0)
  1050.       randomapple(randappleindex).alive=0
  1051.       randomapple(randappleindex).obj=0
  1052.       randomapple(randappleindex).x=count
  1053.       randomapple(randappleindex).y=count2
  1054.       randomapple(randappleindex).z=count3
  1055.      endif
  1056.     endif
  1057.    endif
  1058.   next count3
  1059.  next count2
  1060. next count
  1061.  
  1062. for count=1 to apples
  1063.  read word 1,temp
  1064.  apple(count).start=temp
  1065.  apple(count).timer#=timer()+(temp*1000)
  1066.  read word 1,temp
  1067.  apple(count).min=temp
  1068.  read word 1,temp
  1069.  apple(count).max=temp
  1070. next count
  1071.  
  1072. close file 1
  1073.  
  1074. obno=501
  1075.  
  1076. for count=1 to objs
  1077.  clone object obno,objinfo(count).obj
  1078.  position object obno,objinfo(count).x#,objinfo(count).y#,objinfo(count).z#
  1079.  if objinfo(count).obj=9 or objinfo(count).obj=22 or objinfo(count).obj=23
  1080.   hide object obno
  1081.  endif
  1082.  inc obno
  1083. next count
  1084.  
  1085. for count=1 to 23
  1086. delete object count
  1087. next count
  1088.  
  1089.  
  1090. endif
  1091.  
  1092. load image "gfx\font1\ants.png",2,1
  1093. sprite 1,screen width()*0.01,10,2
  1094. load image "gfx\font1\lives.png",3,1
  1095. sprite 2,0,10,3
  1096. sprite 2,screen width()-sprite width(2)-(screen width()*0.01),10,3
  1097. load image "gfx\font1\score.png",4,1
  1098. sprite 3,screen width()/2,10,4
  1099. offset sprite 3,sprite width(3)/2,0
  1100. load image "gfx\font1\0.png",5,1
  1101. load image "gfx\font1\1.png",6,1
  1102. load image "gfx\font1\2.png",7,1
  1103. load image "gfx\font1\3.png",8,1
  1104. load image "gfx\font1\4.png",9,1
  1105. load image "gfx\font1\5.png",10,1
  1106. load image "gfx\font1\6.png",11,1
  1107. load image "gfx\font1\7.png",12,1
  1108. load image "gfx\font1\8.png",13,1
  1109. load image "gfx\font1\9.png",14,1
  1110. printscore(score)
  1111. printants(ants)
  1112. printlives(lives)
  1113. load image "gfx\a3.png",15,1
  1114. load image "gfx\b3.png",16,1
  1115. make object box 2001,1.5,1.5,1.5
  1116. make object box 2002,1.5,1.5,1.5
  1117. texture object 2001,15
  1118. texture object 2002,16
  1119. set object transparency 2001,1
  1120. set object transparency 2002 ,2
  1121. hide object 2001
  1122. hide object 2002
  1123. load image "gfx\font1\l.png",17,1
  1124. load image "gfx\font1\e.png",18,1
  1125. load image "gfx\font1\v.png",19,1
  1126. load image "gfx\font1\c.png",20,1
  1127. load image "gfx\font1\o.png",21,1
  1128. load image "gfx\font1\m.png",22,1
  1129. load image "gfx\font1\p.png",23,1
  1130. load image "gfx\font1\t.png",24,1
  1131. load image "gfx\crash.png",25,1
  1132. load image "gfx\argh.png",26,1
  1133. load image "gfx\gameover.png",27,1
  1134.  
  1135. return
  1136.  
  1137. keyboardinput:
  1138.  
  1139. if scancode()=0
  1140.  keypress=0
  1141. endif
  1142.  
  1143. if keystate(left)=0 then leftpress=0
  1144. if keystate(right)=0 then rightpress=0
  1145. if keystate(up)=0 then uppress=0
  1146. if keystate(down)=0 then downpress=0
  1147.  
  1148. if keystate(left) and ant(0).xmove#=0 and leftpress=0
  1149.  leftpress=1
  1150.  xdir=-1
  1151.  zdir=0
  1152.  directionpicked=1
  1153. else
  1154.  if keystate(right) and ant(0).xmove#=0 and rightpress=0
  1155.   rightpress=1
  1156.   xdir=1
  1157.   zdir=0
  1158.   directionpicked=1
  1159.  else
  1160.   if keystate(up) and ant(0).zmove#=0 and uppress=0
  1161.    uppress=1
  1162.    zdir=1
  1163.    xdir=0
  1164.    directionpicked=1
  1165.   else
  1166.    if keystate(down) and ant(0).zmove#=0 and downpress=0
  1167.     downpress=1
  1168.     zdir=-1
  1169.     xdir=0
  1170.     directionpicked=1
  1171.    endif
  1172.   endif
  1173.  endif
  1174. endif
  1175.  
  1176.  
  1177. if keystate(30) and keypress=0 and cheat=1 and ants<49
  1178.  makenewant=1
  1179.  keypress=1
  1180. endif
  1181.  
  1182.  
  1183.  
  1184. return
  1185.  
  1186. positionants:
  1187. if destination
  1188.  
  1189. tempx=ant(0).x#
  1190. tempy=ant(0).y#
  1191. tempz=ant(0).z#
  1192.  
  1193. for count=1 to randappleindex
  1194.  if randomapple(count).alive=1
  1195.   if randomapple(count).y=tempy and randomapple(count).x=tempx and randomapple(count).z=tempz
  1196.    makenewant=1
  1197.    score=score+1+ants
  1198.    printscore(score)
  1199.    if score=>extralife and lives<99
  1200.     inc lives,1
  1201.     printlives(lives)
  1202.     if extralife=1000
  1203.      extralife=2500
  1204.     else
  1205.      if extralife=2500
  1206.       extralife=5000
  1207.      else
  1208.       extralife=extralife+5000
  1209.      endif
  1210.     endif
  1211.    endif
  1212.    makepickupparticles(tempx,tempy,tempz)
  1213.    dec applesalive,1
  1214.    hide object randomapple(count).obj
  1215.    randomapple(count).alive=0
  1216.    exit
  1217.   endif
  1218.  endif
  1219. next count
  1220.  
  1221. temp=level(tempx,tempy,tempz).appleno
  1222. if (level(tempx,tempy,tempz).pickup=1 or level(tempx,tempy,tempz).pickup=3 or level(tempx,tempy,tempz).pickup=4) and (apple(temp).alive=1)
  1223.    makepickupparticles(tempx,tempy,tempz)
  1224.    makenewant=1
  1225.    select level(tempx,tempy,tempz).pickup
  1226.    case 1
  1227.     score=score+1+ants
  1228.    endcase
  1229.    case 3
  1230.     score=score+((1+ants)*2)
  1231.    endcase
  1232.    case 4
  1233.     score=score+((1+ants)*4)
  1234.    endcase
  1235.    endselect
  1236.    printscore(score)
  1237.    if score=>extralife and lives<99
  1238.     inc lives,1
  1239.     printlives(lives)
  1240.     if extralife=1000
  1241.      extralife=2500
  1242.     else
  1243.      if extralife=2500
  1244.       extralife=5000
  1245.      else
  1246.       extralife=extralife+5000
  1247.      endif
  1248.     endif
  1249.    endif
  1250.    apple(temp).alive=0
  1251.    apple(temp).timer#=(apple(temp).min*1000)+rnd(((apple(temp).max-apple(temp).min)*1000))+timer()
  1252.    hide object apple(temp).obj
  1253.   endif
  1254.  
  1255. if makenewant
  1256.  inc ants
  1257.  printants(ants)
  1258.  if ants<=200
  1259.   clone object 1000+ants,1000
  1260.   if opantpoly=4
  1261.    yrotate object 1000+ants,180
  1262.    fix object pivot 1000+ants
  1263.   endif
  1264.   loop object 1000+ants
  1265.  endif
  1266.  makenewant=0
  1267. endif
  1268.  
  1269.  if ants>0
  1270.   for count=ants to 1 step -1
  1271.    ant(count).x#=ant(count-1).oldx
  1272.    ant(count).y#=ant(count-1).oldy
  1273.    ant(count).z#=ant(count-1).oldz
  1274.    ant(count).oldx=ant(count-1).oldx
  1275.    ant(count).oldy=ant(count-1).oldy
  1276.    ant(count).oldz=ant(count-1).oldz
  1277.    ant(count).xmoveorig#=ant(count-1).xmoveorig#
  1278.    ant(count).ymoveorig#=ant(count-1).ymoveorig#
  1279.    ant(count).zmoveorig#=ant(count-1).zmoveorig#
  1280.    ant(count).yangle#=ant(count-1).yangle#
  1281.   next count
  1282.  endif
  1283.  
  1284.  
  1285. ydir=0
  1286. tempx=ant(0).x#
  1287. tempy=ant(0).y#
  1288. tempz=ant(0).z#
  1289.  
  1290.  
  1291. if tempy<0
  1292.  gosub argh
  1293.  
  1294. else
  1295.  
  1296.  collide=0
  1297.  if ants>0
  1298.   for count=1 to ants
  1299.    tempx2=ant(count).x#
  1300.    tempy2=ant(count).y#
  1301.    tempz2=ant(count).z#
  1302.    if tempx=tempx2 and tempy=tempy2 and tempz=tempz2
  1303.     collide=1
  1304.     exit
  1305.    endif
  1306.   next count
  1307.  endif
  1308.  
  1309. if collide
  1310.  gosub crash
  1311. else
  1312.  if level(tempx,tempy,tempz).terrain=0
  1313.   tempxdir=xdir
  1314.   tempzdir=zdir
  1315.   xdir=0
  1316.   zdir=0
  1317.   ydir=-1
  1318.  else
  1319.   if level(tempx,tempy,tempz).terrain=2
  1320.    gosub crash
  1321.   else
  1322.    if level(tempx,tempy,tempz).terrain=3
  1323.     ydir=1
  1324.    else
  1325.     if level(tempx,tempy,tempz).terrain=4
  1326.      ydir=-1
  1327.     else
  1328.      if level(tempx,tempy,tempz).terrain=5
  1329.       show object 2001
  1330.      else
  1331.       if level(tempx,tempy,tempz).terrain=6
  1332.        show object 2002
  1333.       endif
  1334.      endif
  1335.     endif
  1336.    endif
  1337.   endif
  1338.  endif
  1339. endif
  1340.  
  1341. endif
  1342.  
  1343. for count=1 to apples
  1344.  if timer()>apple(count).timer# and apple(count).alive=0
  1345.  temp=0
  1346.  for count2=1 to ants
  1347.   if ant(count2).oldx=apple(count).x and ant(count2).oldy=apple(count).y and ant(count2).oldz=apple(count).z
  1348.    temp=1
  1349.    exit
  1350.   endif
  1351.  next count2
  1352.   if temp=0
  1353.    apple(count).alive=1
  1354.    show object apple(count).obj
  1355.   endif
  1356.  endif
  1357. next count
  1358.  
  1359. if timer()>randappletimer# and applesalive<randomapples
  1360.  temp=rnd(randappleindex-1)+1
  1361.  for count= 401 to 400+randomapples
  1362.   if object visible(count)=0
  1363.    tempobj=count
  1364.   endif
  1365.  next count
  1366.  if randomapple(temp).alive=0
  1367.   checkhit=0
  1368.   if ants>0
  1369.    for count2=1 to ants
  1370.     if ant(count2).oldx=randomapple(temp).x and ant(count2).oldy=randomapple(temp).y and ant(count2).oldz=randomapple(temp).z
  1371.      checkhit=1=1
  1372.      exit
  1373.     endif
  1374.    next count2
  1375.   endif
  1376.   if checkhit=0
  1377.    randomapple(temp).obj=tempobj
  1378.    show object tempobj
  1379.    position object tempobj,randomapple(temp).x+0.5,randomapple(temp).y+0.5,randomapple(temp).z-0.5
  1380.    randomapple(temp).alive=1
  1381.    inc applesalive,1
  1382.    temp=rnd(3000)+2000
  1383.    randappletimer#=timer()+temp
  1384.   endif
  1385.  endif
  1386. endif
  1387.  
  1388. if object visible(2001)
  1389.  temp=0
  1390.  for count=0 to ants
  1391.   tempx=ant(count).x#
  1392.   tempy=ant(count).y#
  1393.   tempz=ant(count).z#
  1394.   if level(tempx,tempy,tempz).terrain=5
  1395.    temp=1
  1396.    exit
  1397.   endif
  1398.  next count
  1399.  if temp=0 then hide object 2001
  1400. endif
  1401.  
  1402. if object visible(2002)
  1403.  temp=0
  1404.  for count=0 to ants
  1405.   tempx=ant(count).x#
  1406.   tempy=ant(count).y#
  1407.   tempz=ant(count).z#
  1408.   if level(tempx,tempy,tempz).terrain=6
  1409.    temp=1
  1410.    exit
  1411.   endif
  1412.  next count
  1413.  if temp=0 then hide object 2002
  1414. endif
  1415.  
  1416. if object visible(2001) and object visible(2002)
  1417.  lcvol=50
  1418.  lcx=-130
  1419.  lctimer#=timer()
  1420.  for count=1 to 13
  1421.  if count=1 or count=5 or count=10
  1422.   lcimg=17
  1423.  else
  1424.   if count=2 or count=4 or count=11 or count=13
  1425.    lcimg=18
  1426.   else
  1427.    if count=3
  1428.     lcimg=19
  1429.    else
  1430.     if count=12
  1431.      lcimg=24
  1432.     else
  1433.       lcimg=count+14
  1434.     endif
  1435.    endif
  1436.   endif
  1437.  endif
  1438.  make object plain count+102,25,25
  1439.  texture object count+102,lcimg
  1440.  set object transparency count+102,4
  1441.  set object light count+102,0
  1442.  position object count+102,lcx,0,210
  1443.  lock object on count+102
  1444. ` sync
  1445.  if count=5
  1446.  inc lcx,40
  1447.  else
  1448.  inc lcx,20
  1449.  endif
  1450. for count2=0 to ants
  1451. stop object 1000+count2
  1452. next count2
  1453.  repeat
  1454.  
  1455. if opmusic=1
  1456. set music volume 1,lcvol
  1457. if lcvol>0 then dec lcvol
  1458. endif
  1459. sync
  1460. until timer()>lctimer#
  1461. lctimer#=timer()+50
  1462.  next count
  1463.  set music volume 1,0
  1464.  wait key
  1465. wipeon()
  1466. inc bgno
  1467. if bgno>5 then bgno=1
  1468. inc bgmus
  1469. if bgmus>9 then bgmus=1
  1470. for count=421 to 440
  1471. if object exist(count) then hide object count
  1472. next count
  1473. for count=103 to 115
  1474. delete object count
  1475. next count
  1476. `delete object 103
  1477.  for count=1 to ants
  1478.   delete object count+1000
  1479.  next count
  1480.  for count=1 to 30
  1481.   if sprite exist(count) then delete sprite count
  1482.  next count
  1483.  for count=501 to objs+500
  1484.   delete object count
  1485.  next count
  1486.  for count=2 to 25
  1487.   delete image count
  1488.  next count
  1489.  delete object 2001
  1490.  delete object 2002
  1491.  for count=1 to randomapples
  1492.   delete object count+400
  1493.  next count
  1494.  inc levelno,1
  1495.  if levelno>8 then levelno=1
  1496.  ants=0
  1497.  complete=0
  1498.  applesalive=0
  1499.  undim randomapple(0)
  1500.  dim randomapple(0) as randomappleinfo
  1501.  gosub loadlevelmedia
  1502. frames=maxframes
  1503. seconds#=0
  1504. makenewant=0
  1505. destination=1
  1506. maxframes=0
  1507. gosub positioncamera
  1508. hide object 1000
  1509. wipeoff()
  1510. show object 1000
  1511. loop object 1000
  1512. return
  1513.  
  1514. endif
  1515.  
  1516. headxdest=ant(0).x#+xdir
  1517. ant(0).xmoveorig#=xdir*7
  1518. headydest=ant(0).y#+ydir
  1519. ant(0).ymoveorig#=ydir*7
  1520. headzdest=ant(0).z#+zdir
  1521. ant(0).zmoveorig#=zdir*7
  1522. destination=0
  1523. ant(0).oldx=ant(0).x#
  1524. ant(0).oldy=ant(0).y#
  1525. ant(0).oldz=ant(0).z#
  1526.  
  1527. for count=0 to ants
  1528. ant(count).xmove#=ant(count).xmoveorig#/fps
  1529. ant(count).ymove#=ant(count).ymoveorig#/fps
  1530. ant(count).zmove#=ant(count).zmoveorig#/fps
  1531. next count
  1532.  
  1533.  
  1534.  
  1535. if xdir<0
  1536.  ant(0).yangle#=90
  1537. else
  1538.  if xdir>0
  1539.   ant(0).yangle#=270
  1540.  else
  1541.   if zdir<0
  1542.    ant(0).yangle#=0
  1543.   else
  1544.    if zdir>0
  1545.     ant(0).yangle#=180
  1546.    endif
  1547.   endif
  1548.  endif
  1549. endif
  1550.  
  1551. endif
  1552.  
  1553. speed=3800/fps
  1554. if speed>100 then speed=100
  1555. for count=0 to ants
  1556.  ant(count).x#=ant(count).x#+ant(count).xmove#
  1557.  ant(count).y#=ant(count).y#+ant(count).ymove#
  1558.  ant(count).z#=ant(count).z#+ant(count).zmove#
  1559.  set object speed count+1000,speed
  1560. next count
  1561.  
  1562. temp=0
  1563. if ant(0).xmove#>0
  1564.  if ant(0).x#=>headxdest
  1565.   temp=1
  1566.   ant(0).x#=headxdest
  1567.   destination=1
  1568.  endif
  1569. else
  1570.  if ant(0).xmove#<0
  1571.   if ant(0).x#=<headxdest
  1572.    temp=1
  1573.    ant(0).x#=headxdest
  1574.    destination=1
  1575.   endif
  1576.  else
  1577.   if ant(0).zmove#>0
  1578.    if ant(0).z#=>headzdest
  1579.     temp=1
  1580.     ant(0).z#=headzdest
  1581.     destination=1
  1582.    endif
  1583.   else
  1584.    if ant(0).zmove#<0
  1585.     if ant(0).z#=<headzdest
  1586.      temp=1
  1587.      ant(0).z#=headzdest
  1588.      destination=1
  1589.     endif
  1590.    else
  1591.     if ant(0).ymove#<0
  1592.      if ant(0).y#=<headydest
  1593.       temp=1
  1594.       ant(0).y#=headydest
  1595.       zdir=tempzdir
  1596.       xdir=tempxdir
  1597.       destination=1
  1598.      endif
  1599.     endif
  1600.    endif
  1601.   endif
  1602.  endif
  1603. endif
  1604.  
  1605.  
  1606. if temp
  1607. ant(0).y#=headydest
  1608. ` if ants>1
  1609.   for count=ants to 1 step -1
  1610.    ant(count).x#=ant(count-1).oldx
  1611.    ant(count).y#=ant(count-1).oldy
  1612.    ant(count).z#=ant(count-1).oldz
  1613.   next count
  1614. endif
  1615.  
  1616. for count=0 to ants
  1617.  position object 1000+count,ant(count).x#+0.5,ant(count).y#+yoffset#,ant(count).z#-0.5
  1618.  yrotate object 1000+count,ant(count).yangle#
  1619. next count
  1620. return
  1621.  
  1622. positioncamera:
  1623. position camera ant(0).x#,ant(0).y#+10,ant(0).z#-15
  1624. point camera ant(0).x#,ant(0).y#,ant(0).z#
  1625.  
  1626. return
  1627.  
  1628.  
  1629. crash:
  1630. stop music 1
  1631. play sound 2
  1632. for count=1 to ants
  1633. stop object count+1000
  1634. next count
  1635. make object plain 99,250,250
  1636. position object 99,0,0,210
  1637. texture object 99,25
  1638. set object light 99,0
  1639. set object transparency 99,4
  1640. lock object on 99
  1641. sync
  1642. wait key
  1643. if lives=1
  1644. delete object 99
  1645. make object plain 99,250,250
  1646. position object 99,0,0,210
  1647. texture object 99,27
  1648. set object light 99,0
  1649. set object transparency 99,4
  1650. lock object on 99
  1651. play sound 4
  1652. sync
  1653. wait key
  1654. wipeon()
  1655. delete music 1
  1656.  for x=1 to 4
  1657.  delete sound x
  1658.  next x
  1659.  for x=1000 to 1000+ants
  1660.  delete object x
  1661.  next x
  1662.  for x=400 to 500+objs
  1663.  if object exist(x) then delete object x
  1664.  next x
  1665.  for x=1 to 100
  1666.  if sprite exist(x) then delete sprite x
  1667.  if image exist(x) then delete image x
  1668.  next x
  1669.  set display mode 800,600,32
  1670.  gosub highscoretable
  1671.  goto menu
  1672. endif
  1673. wipeon()
  1674. for count=1 to 20
  1675. if object exist(count+420) then hide object count+420
  1676. next count
  1677. delete object 99
  1678. for count=1 to ants
  1679.  delete object count+1000
  1680. next count
  1681. for count=501 to objs+500
  1682.  delete object count
  1683. next count
  1684. for count=2 to 25
  1685.  delete image count
  1686. next count
  1687.  delete object 2001
  1688.  delete object 2002
  1689. for count=1 to randomapples
  1690.  delete object count+400
  1691. next count
  1692. dec lives,1
  1693. ants=0
  1694. applesalive=0
  1695. undim randomapple(0)
  1696. dim randomapple(0) as randomappleinfo
  1697.  gosub loadlevelmedia
  1698. makenewant=0
  1699. destination=1
  1700.  
  1701. for count=4 to 17
  1702.  if sprite exist(count) then delete sprite count
  1703. next count
  1704. printscore(score)
  1705. printants(ants)
  1706. printlives(lives)
  1707. hide object 1000
  1708. gosub positioncamera
  1709. wipeoff()
  1710. show object 1000
  1711. seconds#=timer()-1
  1712. frames=39
  1713. return
  1714.  
  1715.  
  1716.  
  1717. argh:
  1718. stop music 1
  1719. play sound 1
  1720. yvel#=0
  1721. make object plain 99,250,250
  1722. position object 99,0,0,210
  1723. texture object 99,26
  1724. set object light 99,0
  1725. set object transparency 99,4
  1726. lock object on 99
  1727. repeat
  1728. for count=ants to 1 step -1
  1729.  ant(count).x#=ant(count-1).x#
  1730.  ant(count).z#=ant(count-1).z#
  1731. next count
  1732. if yvel#<(150.0/fps) then yvel#=yvel#+(1.0/fps)
  1733. tempx=ant(0).x#
  1734. tempz=ant(0).z#
  1735. for count=0 to ants
  1736.  temp2x=ant(count).x#
  1737.  temp2z=ant(count).z#
  1738.  if tempx=temp2x and tempz=temp2z
  1739.   ant(count).y#=ant(count).y#-yvel#
  1740.  endif
  1741.  position object 1000+count,ant(count).x#+0.5,ant(count).y#+yoffset#,ant(count).z#-0.5
  1742. next count
  1743. if ant(0).y#>-50 then gosub positioncamera
  1744. sync
  1745. until ant(0).y#<-150
  1746. wait key
  1747. if lives=1
  1748. delete object 99
  1749. make object plain 99,250,250
  1750. position object 99,0,0,210
  1751. texture object 99,27
  1752. set object light 99,0
  1753. set object transparency 99,4
  1754. lock object on 99
  1755. play sound 4
  1756. sync
  1757. wait key
  1758. wipeon()
  1759. for count=421 to 440
  1760. if object exist(count) then hide object count
  1761. next count
  1762. delete music 1
  1763.  for x=1 to 4
  1764.  delete sound x
  1765.  next x
  1766.  for x=1000 to 1000+ants
  1767.  delete object x
  1768.  next x
  1769.  for x=400 to 500+objs
  1770.  if object exist(x) then delete object x
  1771.  next x
  1772.  for x=1 to 100
  1773.  if sprite exist(x) then delete sprite x
  1774.  if image exist(x) then delete image x
  1775.  next x
  1776.  set display mode 800,600,32
  1777.  gosub highscoretable
  1778.  goto menu
  1779. endif
  1780. wipeon()
  1781. delete object 99
  1782.  for count=1 to ants
  1783.   delete object count+1000
  1784.  next count
  1785.  for count=501 to objs+500
  1786.   delete object count
  1787.  next count
  1788.  for count=2 to 25
  1789.   delete image count
  1790.  next count
  1791.  delete object 2001
  1792.  delete object 2002
  1793.  for count=1 to randomapples
  1794.   delete object count+400
  1795.  next count
  1796.  dec lives,1
  1797.  ants=0
  1798.  applesalive=0
  1799.  undim randomapple(0)
  1800.  dim randomapple(0) as randomappleinfo
  1801.  gosub loadlevelmedia
  1802. makenewant=0
  1803. destination=1
  1804. loop object 1000
  1805.  
  1806. for count=4 to 17
  1807.  if sprite exist(count) then delete sprite count
  1808. next count
  1809. printscore(score)
  1810. printants(ants)
  1811. printlives(lives)
  1812. hide object 1000
  1813. gosub positioncamera
  1814. wipeoff()
  1815. seconds#=timer()-1
  1816. frames=39
  1817. show object 1000
  1818. return
  1819.  
  1820. movepickupparticles:
  1821. for count=1 to 20
  1822. if pickupparticle(count).alive
  1823.  
  1824.  pickupparticle(count).x#=pickupparticle(count).x#+(pickupparticle(count).xvel#/fps)
  1825.  
  1826.  pickupparticle(count).y#=pickupparticle(count).y#+(pickupparticle(count).yvel#/fps)
  1827.  pickupparticle(count).yvel#=pickupparticle(count).yvel#-(100.0/fps)
  1828.  position object count+420,pickupparticle(count).x#,pickupparticle(count).y#,pickupparticle(count).z#
  1829.  if pickupparticle(count).fade#<0
  1830.   pickupparticle(count).fade#=0
  1831.   pickupparticle(count).alive=0
  1832.   hide object count+420
  1833.  else
  1834.   scale object count+420,pickupparticle(count).fade#,pickupparticle(count).fade#,100
  1835.   dec pickupparticle(count).fade#,0.5
  1836.   point object count+420,camera position x(),camera position y(),camera position z()
  1837.   tempx2=pickupparticle(count).x#
  1838.   tempy2=pickupparticle(count).y#
  1839.   tempz2=pickupparticle(count).z#
  1840.   if tempy2>0 and tempy2<9
  1841.    if level(tempx2,tempy2,tempz2).terrain=2
  1842.     pickupparticle(count).alive=0
  1843.     hide object count+420
  1844.    endif
  1845.   endif
  1846.  endif
  1847. endif
  1848. next count
  1849. return
  1850.  
  1851.  
  1852. highscoretable:
  1853. gosub loadmenumedia
  1854. `load music "sound\midi\hiscore1.mid",5
  1855. `loop music 5
  1856. sprite 68,0,0,2
  1857.  
  1858. open to read 1,"leveldata\level10.dat"
  1859. for x=1 to 10
  1860.  read string 1,temp$
  1861.  highscore(x).name$=temp$
  1862.  read file 1,temp
  1863.  highscore(x).score=temp
  1864. next x
  1865. close file 1
  1866.  
  1867. if score>highscore(10).score
  1868.  
  1869. load music "sound\midi\hiscore1.mid",5
  1870. loop music 5
  1871.  
  1872.  mess$="congratulations you got"
  1873.  mess2$="a high score"
  1874.  mess3$="please enter your name"
  1875.  xpos=40
  1876.  for x=1 to 23
  1877.   if mid$(mess$,x)=" "
  1878.    inc xpos,20
  1879.   else
  1880.    sprite x,xpos,100,asc(mid$(mess$,x))
  1881.    inc xpos,sprite width(x)+5
  1882.   endif
  1883.  next x
  1884.  xpos=200
  1885.  for x=1 to 12
  1886.   if mid$(mess2$,x)=" "
  1887.    inc xpos,20
  1888.   else
  1889.    sprite x+23,xpos,150,asc(mid$(mess2$,x))
  1890.    inc xpos,sprite width(x+23)+5
  1891.   endif
  1892.  next x
  1893.  xpos=65
  1894.  for x=1 to 22
  1895.   if mid$(mess3$,x)=" "
  1896.    inc xpos,20
  1897.   else
  1898.    sprite x+45,xpos,300,asc(mid$(mess3$,x))
  1899.    inc xpos,sprite width(x+45)+5
  1900.   endif
  1901.  next x
  1902.  name$=""
  1903. sprite 1000,400,300,1
  1904. offset sprite 1000,400,300
  1905. set sprite priority 1000,10
  1906. scale=100
  1907. alph=255
  1908. repeat
  1909. scale sprite 1000,scale
  1910. inc scale,10
  1911. if scale>800 and alph=>0
  1912.  set sprite alpha 1000,alph
  1913.  dec alph,10
  1914. endif
  1915. sync
  1916. until scale>1000 and alph<0
  1917. delete sprite 1000
  1918.  curstimer=timer()+100
  1919.  
  1920.  repeat
  1921.  if timer()>curstimer
  1922.   if sprite visible(69)
  1923.    hide sprite 69
  1924.   else
  1925.    show sprite 69
  1926.   endif
  1927.  curstimer=timer()+100
  1928.  endif
  1929.  
  1930.  if scancode()=0 then keypressed=0
  1931.  
  1932.  if keytype$(scancode())<>"" and len(name$)<15 and keypressed=0
  1933.   keypressed=1
  1934.   name$=name$+keytype$(scancode())
  1935.  endif
  1936.  
  1937.  if scancode()=14 and keypressed=0 and len(name$)>0
  1938.   keypressed=1
  1939.   name$=left$(name$,len(name$)-1)
  1940.  endif
  1941.  
  1942. for x=70 to 85
  1943. if sprite exist(x) then delete sprite x
  1944. next x
  1945.  
  1946.  xpos=140
  1947.  for x=1 to len(name$)
  1948.   if mid$(name$,x)=" "
  1949.    inc xpos,20
  1950.   else
  1951.    sprite x+69,xpos,400,asc(mid$(name$,x))
  1952.    inc xpos,sprite width(x+69)+5
  1953.   endif
  1954.  next x
  1955.  
  1956.  curspos=xpos
  1957.  
  1958. sprite 69,curspos,400,42
  1959. size sprite 69,25,25
  1960.  
  1961.  
  1962.  sync
  1963.  until scancode()=28 or scancode()=156
  1964.  for x=1 to 10
  1965.  if score>highscore(x).score
  1966.   if x<10
  1967.    for y=10 to x+1 step -1
  1968.     highscore(y).score=highscore(y-1).score
  1969.     highscore(y).name$=highscore(y-1).name$
  1970.    next y
  1971.   endif
  1972.   highscore(x).score=score
  1973.   highscore(x).name$=name$
  1974.   exit
  1975.  endif
  1976. next x
  1977.  
  1978. delete file "leveldata\level10.dat"
  1979. open to write 1,"leveldata\level10.dat"
  1980. for x=1 to 10
  1981.  temp$=highscore(x).name$
  1982.  write string 1,temp$
  1983.  temp=highscore(x).score
  1984.  write file 1,temp
  1985. next x
  1986. close file 1
  1987.  
  1988. sprite 1000,400,300,1
  1989. offset sprite 1000,400,300
  1990. set sprite priority 1000,10
  1991. scale=1000
  1992. repeat
  1993. scale sprite 1000,scale
  1994. dec scale,10
  1995. sync
  1996. until scale<100
  1997. delete sprite 1000
  1998.  
  1999.  for  x=1 to 100
  2000.  if sprite exist(x) then delete sprite x
  2001.  next x
  2002.  delete music 5
  2003.  
  2004.  
  2005.  
  2006. endif
  2007.  
  2008. load music "sound\midi\hiscore2.mid",5
  2009. loop music 5
  2010.  
  2011. sprite 1,0,0,2
  2012. sprno=2
  2013. temp$="high score table"
  2014. xpos=150
  2015. for x=1 to 16
  2016.  if mid$(temp$,x)<>" "
  2017.   sprite sprno,xpos,25,asc(mid$(temp$,x))
  2018.   inc xpos,sprite width(sprno)+5
  2019.   inc sprno,1
  2020.  else
  2021.   inc xpos,20
  2022.  endif
  2023. next x
  2024. for x=1 to 10
  2025.  xpos=80
  2026.  for y=1 to len(highscore(x).name$)
  2027.   if mid$(highscore(x).name$,y)<>" "
  2028.    sprite sprno,xpos,x*40+50,asc(mid$(highscore(x).name$,y))
  2029.    inc xpos,sprite width(sprno)+2
  2030.    inc sprno,1
  2031.   else
  2032.    inc xpos,20
  2033.   endif
  2034.  next y
  2035.  xpos=500
  2036.  for y=1 to len(str$(highscore(x).score))
  2037.   sprite sprno,xpos,x*40+50,asc(mid$(str$(highscore(x).score),y))
  2038.   inc xpos,sprite width(sprno)+2
  2039.   inc sprno,1
  2040.  next y
  2041. next x
  2042.  
  2043.  
  2044. sprite 1000,400,300,1
  2045. offset sprite 1000,400,300
  2046. set sprite priority 1000,10
  2047. scale=100
  2048. alph=255
  2049. repeat
  2050. scale sprite 1000,scale
  2051. inc scale,10
  2052. if scale>800 and alph=>0
  2053.  set sprite alpha 1000,alph
  2054.  dec alph,1
  2055. endif
  2056. sync
  2057. until scale>1000 and alph<0
  2058. delete sprite 1000
  2059.  sync
  2060.  wait key
  2061.  for x=1 to sprno
  2062.   if sprite exist(x) then delete sprite x
  2063.  next x
  2064. sprite 1000,400,300,1
  2065. offset sprite 1000,400,300
  2066. set sprite priority 1000,10
  2067. scale=1000
  2068. repeat
  2069. scale sprite 1000,scale
  2070. dec scale,10
  2071. sync
  2072. until scale<100
  2073. delete sprite 1000
  2074. delete music 5
  2075. return
  2076.  
  2077.  
  2078.  
  2079. function wipeon()
  2080. make object plain 101,250,250
  2081. texture object 101,42
  2082. set object texture 101,2,0
  2083. set object transparency 101,4
  2084. set object light 101,0
  2085. position object 101,-70,0,200
  2086. lock object on 101
  2087. make object plain 102,250,250
  2088. zrotate object 102,180
  2089. texture object 102,42
  2090. set object texture 102,2,0
  2091. set object transparency 102,4
  2092. set object light 102,0
  2093. position object 102,70,0,200
  2094. lock object on 102
  2095. y=250
  2096. for x=-250 to -70 step 3
  2097. position object 101,x,0,200
  2098. position object 102,y,0,200
  2099. dec y,3
  2100. sync
  2101. next x
  2102. endfunction
  2103.  
  2104. function wipeoff()
  2105.  
  2106. y=70
  2107. for x=-70 to -250 step -3
  2108. position object 101,x,0,200
  2109. position object 102,y,0,200
  2110. inc y,3
  2111. sync
  2112. next x
  2113. delete object 101
  2114. delete object 102
  2115.  
  2116. endfunction
  2117.  
  2118. function pausegame(tempsecs#,music,ants)
  2119.  
  2120. vol=50
  2121. pgchoice=1
  2122. for x=0 to ants
  2123.  stop object x+1000
  2124. next x
  2125.  
  2126. make object plain 99,120,120
  2127. position object 99,0,0,210
  2128. texture object 99,33
  2129. set object light 99,0
  2130. set object transparency 99,1
  2131. lock object on 99
  2132. make object plain 98,100,100
  2133. position object 98,0,0,210
  2134. texture object 98,35
  2135. set object light 98,0
  2136. set object transparency 98,1
  2137. lock object on 98
  2138.  
  2139. make object plain 97,100,100
  2140. position object 97,0,-30,210
  2141. texture object 97,36
  2142. set object light 97,0
  2143. set object transparency 97,1
  2144. lock object on 97
  2145.  
  2146. repeat
  2147. if music=1 and vol=>0
  2148.  set music volume 1,vol
  2149.  dec vol,1
  2150. endif
  2151. if upkey() and pgchoice=2
  2152. pgchoice=1
  2153. endif
  2154. if downkey() and pgchoice=1
  2155. pgchoice=2
  2156. endif
  2157.  
  2158. if pgchoice=2
  2159. scale object 98,50,50,100
  2160. scale object 97,100,100,100
  2161. else
  2162. scale object 98,100,100,100
  2163. scale object 97,50,50,100
  2164. endif
  2165.  
  2166. sync
  2167. until keystate(28) or keystate(156)
  2168.  
  2169. quit=0
  2170. if pgchoice=2
  2171.  quit=1
  2172.  wipeon()
  2173. endif
  2174. if music=1 then set music volume 1,50
  2175. for x=0 to ants
  2176.  loop object x+1000
  2177. next x
  2178. for pgcount=97 to 99
  2179.  delete object pgcount
  2180. next pgcount
  2181. tempsecs#=timer()+tempsecs#
  2182. endfunction tempsecs#
  2183.  
  2184. function makepickupparticles(x#,y#,z#)
  2185.  
  2186. play sound 3
  2187. `xvel#=0.01
  2188. `yvel#=0.05
  2189. xstart#=-0.5
  2190. for count=1 to 10
  2191.  pickupparticle(particleindex).x#=x#
  2192.  pickupparticle(particleindex).y#=y#
  2193.  pickupparticle(particleindex).z#=z#
  2194.  pickupparticle(particleindex).xvel#=(0.0+(xstart#/50))*200
  2195.  temp#=rnd(140)
  2196.  temp#=temp#/10
  2197.  temp#=temp#+17.0
  2198.  pickupparticle(particleindex).yvel#=temp#
  2199.  pickupparticle(particleindex).alive=1
  2200.  show object particleindex+420
  2201.  temp=rnd(30)+70
  2202.  scale object particleindex+420,temp,temp,100
  2203.  pickupparticle(particleindex).fade#=temp
  2204.  inc particleindex
  2205.  if particleindex>20 then particleindex=1
  2206.  xstart#=xstart#+0.25
  2207. next count
  2208.  
  2209. endfunction
  2210.  
  2211. function printscore(score)
  2212.  
  2213. width=0
  2214.  
  2215. tenmil=score/10000000
  2216. score=score-(tenmil*10000000)
  2217.  
  2218. mil=score/1000000
  2219. score=score-(mil*1000000)
  2220.  
  2221. hundthou=score/100000
  2222. score=score-(hundthou*100000)
  2223.  
  2224. tenthou=score/10000
  2225. score=score-(tenthou*10000)
  2226.  
  2227. thou=score/1000
  2228. score=score-(thou*1000)
  2229.  
  2230. hund=score/100
  2231. score=score-(hund*100)
  2232.  
  2233. ten=score/10
  2234. score=score-(ten*10)
  2235.  
  2236. units=score
  2237.  
  2238. places=1
  2239.  
  2240. if ten then places=2
  2241. if hund then places=3
  2242. if thou then places=4
  2243. if tenthou then places=5
  2244. if hundthou then places=6
  2245. if mil then places=7
  2246. if tenmil then places=8
  2247.  
  2248. dim scores(8)
  2249. scores(8)=tenmil
  2250. scores(7)=mil
  2251. scores(6)=hundthou
  2252. scores(5)=tenthou
  2253. scores(4)=thou
  2254. scores(3)=hund
  2255. scores(2)=ten
  2256. scores(1)=units
  2257.  
  2258. for count=places to 1 step -1
  2259.  
  2260.  sprite count+3,0,0,scores(count)+5
  2261.  width=width+sprite width(count+3)+5
  2262. next count
  2263.  
  2264. xpos=(screen width()-width)/2
  2265. for count=places to 1 step -1
  2266.  sprite count+3,xpos,50,scores(count)+5
  2267.  xpos=xpos+5+sprite width(count+3)
  2268. next count
  2269.  
  2270. endfunction
  2271.  
  2272. function printants(ants)
  2273.  
  2274. width=0
  2275. inc ants,1
  2276.  
  2277. hund=ants/100
  2278. ants=ants-(hund*100)
  2279.  
  2280. ten=ants/10
  2281. ants=ants-(ten*10)
  2282.  
  2283. units=ants
  2284.  
  2285. places=1
  2286.  
  2287. if ten then places=2
  2288. if hund then places=3
  2289.  
  2290. dim antz(3)
  2291.  
  2292. antz(3)=hund
  2293. antz(2)=ten
  2294. antz(1)=units
  2295.  
  2296. for count=places to 1 step -1
  2297.  
  2298.  sprite count+11,0,0,antz(count)+5
  2299.  width=width+sprite width(count+11)+5
  2300. next count
  2301.  
  2302. xpos=55-(width/2)
  2303. for count=places to 1 step -1
  2304.  sprite count+11,xpos,50,antz(count)+5
  2305.  xpos=xpos+5+sprite width(count+11)
  2306. next count
  2307.  
  2308.  
  2309. endfunction
  2310.  
  2311. function printlives(lives)
  2312.  
  2313.  
  2314.  
  2315. width=0
  2316.  
  2317. hund=lives/100
  2318. lives=lives-(hund*100)
  2319.  
  2320. ten=lives/10
  2321. lives=lives-(ten*10)
  2322.  
  2323. units=lives
  2324.  
  2325. places=1
  2326.  
  2327. if ten then places=2
  2328. if hund then places=3
  2329.  
  2330. dim life(3)
  2331.  
  2332. life(3)=hund
  2333. life(2)=ten
  2334. life(1)=units
  2335.  
  2336. for count=places to 1 step -1
  2337.  
  2338.  sprite count+14,0,0,life(count)+5
  2339.  width=width+sprite width(count+14)+5
  2340. next count
  2341.  
  2342. xpos=(screen width()-60)-(width/2)
  2343. for count=places to 1 step -1
  2344.  sprite count+14,xpos,50,life(count)+5
  2345.  xpos=xpos+5+sprite width(count+14)
  2346. next count
  2347.  
  2348. endfunction
  2349.  
  2350.  
  2351.  
  2352.  
  2353.